package com.zhongke.cotrun.model.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.zhongke.cotrun.model.validator.UserValidator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.servlet.tags.EditorAwareTag;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.math.BigInteger;
import java.util.Date;

@ApiModel(value = "用户基本信息表单")
@Data
public class UserInfo {
    //
    @ApiModelProperty(value = "id号", example = "123")
    @NotNull(message = "id不能为空", groups = {UserValidator.UpDate.class})
    private Integer userId;// 用户id


    @ApiModelProperty(value = "状态 0:正常 1:删除/注销 2:禁用", example = "0")
    private Short state;//状态 0:正常 1:删除/注销 2:禁用

    @ApiModelProperty(value = "账号类型,个人和企业用户注册时候必填字段 1 个人2 机构 ")
    @NotBlank(message = "账号类型不能为空", groups = {UserValidator.InSet.class})
    private String type;//账号类型：1 个人2 机构
    @ApiModelProperty(value = "添加该账号的用户id(管理员id)", example = "123")
    private BigInteger addId;//添加该账号的用户id(管理员id)

    @ApiModelProperty(value = "用户的真实姓名,个人用户注册时候必填字段")
    @NotBlank(message = "真实姓名不能为空", groups = {UserValidator.Persion.class})
    private String realName;//真实姓名
    @ApiModelProperty(value = "登录用户名(如：域账号,C端 登录用户名)")
    private String loginName;// 登录用户名(如：域账号,C端 登录用户名)

    @ApiModelProperty(value = "用户的邮箱,个人和企业用户注册时候必填字段")
    @NotBlank(message = "邮箱不能为空")
    @Email(message = "邮箱格式不正确", groups = {UserValidator.UpDate.class})
    private String email;// 邮箱地址
    @ApiModelProperty(value = "昵称")
    private String nickname;//昵称
    @ApiModelProperty(value = "用户的手机号,个人和企业用户注册时候必填字段")
    @NotNull(message = "手机号不能为空")
    @Pattern(regexp = "^[1][3,4,5,6,7,8,9][0-9]{9}$", message = "手机号码格式错误", groups = {UserValidator.InSet.class})
    private String phoneNumber;//手机号
    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;//创建时间
    @ApiModelProperty(value = "最后更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;//最后更新时间
    @ApiModelProperty(value = "备注")
    private String comment;//备注  0没有要审核的信息，11专家待审核 12 项目待审核 13服务商待审核 驳回
    @ApiModelProperty(value = "用户的密码,个人和企业用户注册时候必填字段")
    @NotBlank(message = "密码不能为空", groups = {UserValidator.InSet.class})
    @Length(message = "密码长度在6-10之间", min = 6, max = 10, groups = {UserValidator.InSet.class})
    private String passwd;//密码

    @ApiModelProperty(value = "用户身份")
    private String identity;//用户身份多个身份用,隔开审核通过给他加上身份识别 1专家
    @ApiModelProperty(value = "验证码,个人和企业用户注册时候必填字段")
    @NotBlank(message = "验证码不能为空", groups = {UserValidator.InSet.class})
    private String message;//验证码（数据库没有的字段）
    @ApiModelProperty(value = "//性别 0男 1女", example = "0")
    private Short sex;//性别 0男 1女
    @ApiModelProperty(value = "//出生日期")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date birthdate;//出生日期
    @ApiModelProperty(value = "//省")
    private String province;//省
    @ApiModelProperty(value = "//市")
    private String city;//市
    @ApiModelProperty(value = "//头像")
    private String accountHead;//头像

    @ApiModelProperty(value = "//工作单位")
    private String workUnit;//工作单位

    @ApiModelProperty(value = "//审核状态查询接口")
    private Integer auditStatus; //审核状态查询接口待审核0通过1驳回2

    @ApiModelProperty(value = "//是否完善信息0否1是")
    private Integer complete;//是否完善信息0否1是

    @ApiModelProperty(value = "//关键词")
    private String keyWord;//关键词

    private ExpertInfo expertInfo;//关联专家补充信息表

    private Facilitator facilitator;//关联的服务商信息

    private String sort;//排序

    private String provinceName;//省转义
    private String cityName;//市转义

    @ApiModelProperty(value = "邀请码")
    private String shareNum; 
    @ApiModelProperty(value = "邀请用户")
    private Integer shareUserId;
}
